set the visible of card field 1 to not the visible of card field 1
if the visible of card field 1 is true then
set the name of me to "Hide Pascal Source"
else set the name of me to "Show Pascal Source"
end mouseUp
-- part contents for background part 16
----- text -----
OBJECTEXISTS XFCN version 1.0
Kevin Calhoun
ObjectExists determines whether or not a HyperCard object exists. The bad news is that it's not perfect, for three reasons:
1) If you want to ask by name (rather than by id or number) about an object with a short name longer than one word, you have to store the long name of the object in a container and then pass the container to ObjectExists. For instance, to find out about card button "Show Pascal Source", you can use the following HyperTalk code:
put "card btn" && quote & "Show Pascal Source" & quote into theButton
get ObjectExists(theButton)
This is an instance of the general problem of quoting in HyperCard.
2) If you want to find out whether a stack exists and the stack does not exist in any directory contained in the current Home stack's "Look for stacks in…" field, HyperCard will invoke the standard file package and ask the user to find the stack. If the user selects a stack from the standard file dialog, ObjectExists returns TRUE whether or not the user selected the stack you designated. If the user presses Cancel, ObjectExists returns FALSE, regardless of whether the stack is actually on the disk.
3) In versions of HyperCard earlier than 1.2, it causes the dreaded "Never heard of…" dialog box to appear when the object you designate does not exist.
INVOKING OBJECTEXISTS
get ObjectExists(objectDesignation)
result: true or false
EXAMPLES
get ObjectExists("card field Watusi")
get ObjectExists("bg btn 15")
get ObjectExists("card id 2731")
get ObjectExists("stack Home")
get ObjectExists("background WildCard")
-- part contents for card part 1
----- text -----
UNIT BecauseRogerAskedForIt;
{ This XFCN requires HyperCard 1.2 or later }
{ ObjectExists XFCN ©1989 by the Trustees of Dartmouth College }